Skip to content

perf(zisk): drop the software G1 subgroup pre-check of BLS12-381 precompiles - #62

Merged
figtracer merged 1 commit into
paradigmxyz:mainfrom
han0110:feature/remove-subgroup-check-for-zisk
Nov 16, 2026
Merged

figtracer merged 1 commit into
paradigmxyz:mainfrom
han0110:feature/remove-subgroup-check-for-zisk

Conversation

@han0110

@han0110 han0110 commented Nov 16, 2026

Copy link
Copy Markdown
Contributor

Removes validate_zisk_bls12_g1_subgroups, which ran arkworks on every G1 point before ZisK's BLS12-381 G1 MSM and pairing.

Why it existed

It was added against ZisK 1.0.0-alpha, whose G1 subgroup check used incomplete point formulas and panicked in the hints on points outside the subgroup.

Why it is no longer needed

Since ZisK 1.1.0-alpha (with 0xPolygonHermez/zisk@4ba9bd7ad), the check uses complete formulas. The guest MSM and pairing return an error for such points, and the hints do not panic.

Benchmark

Estimated cost on ZisK 1.4.0-alpha, 112 test_bls12_381.py tests from tests-zkevm-benchmark@v21.0.5 (60M to 200M gas):

Test After / before
test_bls12_g1_msm 0.030
test_bls12_pairing_uncachable 0.429
test_bls12_pairing 0.715
test_bls12_381_uncachable 0.822
test_bls12_381 0.964
test_bls12_g2_msm 1.000
All 0.593

…MSM and pairing

The ZisK guest ran revm's arkworks DefaultCrypto G1 MSM with zero scalars on
every input point before calling ZisK's G1 MSM and pairing, only to reject
points outside the G1 subgroup. That workaround dates from ZisK 1.0.0-alpha,
whose subgroup check used incomplete point formulas. Since ZisK 1.1.0-alpha
(zisk 4ba9bd7ad) the check uses complete formulas, and the guest-side MSM and
pairing reject such points with an error code in both the guest and the hint
paths. The repo pins ZisK 1.4.0-alpha through ere v0.20.0, so the pre-check
only costs cycles: removing it makes BLS12-381 G1 MSM about 33x cheaper.
@figtracer
figtracer merged commit 7df3897 into paradigmxyz:main Nov 16, 2026
6 checks passed
@han0110
han0110 deleted the feature/remove-subgroup-check-for-zisk branch November 16, 2026 09:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants